<?php
namespace app\index\controller;

use think\Controller;

class Common extends Controller{
	/**
	 * 自动执行的方法
	 */
	public function _initialize()
	{

		$route = strtolower(request()->module()."/".request()->controller()."/".request()->action());

		$auth = config('auth');

		if(in_array($route,$auth)){
			if(!session('uid')){
				$this->error('请先登录!!!');
			}
		}
	}
}